let dataMgr = require("./DataMgr")
cc.Class({
    extends: cc.Component,

    properties: {
        closeBtn: cc.Node,
        background: cc.Node,

    },



    onLoad() {
        this.closeBtn.on("click", this.onCloseBtn, this)
    },

    start() {

    },

    // update (dt) {},
    onCloseBtn() {
        let pageViewComp = this.node.getComponent(cc.PageView);
        let roleIndex = pageViewComp.getCurrentPageIndex();
        dataMgr.getInstance().saveData("roleIndex", roleIndex);
        this.background.active = true;
        this.node.active = false;
    },
});
